﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using Leadtools;
using Leadtools.Forms;
using Leadtools.WinForms;

namespace Smallerp.Contracts.DataContracts
{
    [DataContract]
    public class PhotoDCT
    {
        #region 私有字段
        private int _orderProductId;
        private int _photoId;
        private string _photoName;
        private double _height;
        private double _width;
        private int _pixWidth;
        private int _pixHeight;

        private string _picPath;
        private string _remark;
        private int _printerId;
        private int _status;
        private int _totalNum;
        private int _userId;
        private bool _isReback;
        private int _sameFlagPhotoId;
        #endregion
        [DataMember]
        public string PicOripath { get; set; }
        #region 公开属性
        [DataMember]
        public int OrderProductId
        {
            get { return _orderProductId; }
            set { _orderProductId = value; }
        }
        [DataMember]
        public int PhotoId
        {
            get { return _photoId; }
            set { _photoId = value; }
        }
        [DataMember]
        public string PhotoName
        {
            get { return _photoName; }
            set { _photoName = value; }
        }
        [DataMember]
        public double Height
        {
            get { return _height; }
            set { _height = value; }
        }
        [DataMember]
        public double Width
        {
            get { return _width; }
            set { _width = value; }
        }
        [DataMember]
        public int PixWidth
        {
            get { return _pixWidth; }
            set { _pixWidth = value; }
        }
        [DataMember]
        public int PixHeight
        {
            get { return _pixHeight; }
            set { _pixHeight = value; }
        }
        [DataMember]
        public string PicPath
        {
            get { return _picPath; }
            set { _picPath = value; }
        }
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }
        [DataMember]
        public int PrinterId
        {
            get { return _printerId; }
            set { _printerId = value; }
        }
        [DataMember]
        public int Status
        {
            get { return _status; }
            set { _status = value; }
        }
        [DataMember]
        public int TotalNum
        {
            get { return _totalNum; }
            set { _totalNum = value; }
        }
        [DataMember]
        public int UserId
        {
            get { return _userId; }
            set { _userId = value; }
        }
        [DataMember]
        public bool IsReback
        {
            get { return _isReback; }
            set { _isReback = value; }
        }
        [DataMember]
        public int SameFlagPhotoId
        {
            get { return _sameFlagPhotoId; }
            set { _sameFlagPhotoId = value; }
        }
        #endregion
        [DataMember]
        public string _sizeInch;
        [DataMember]
        public string SizeInch
        {
            set { _sizeInch = value; }
            get { return string.Format("{0:0.##}", Height) + "×" + string.Format("{0:0.##}", Width); }
        }

        private string _sizeCM;
        [DataMember]
        public string SizeCM
        {
            set { _sizeCM = value; }
            get { return string.Format("{0:0.##}", Height * 2.54) + "×" + string.Format("{0:0.##}", Width * 2.54); }
        }
        [DataMember]
        public string PaperFace
        {
            get;
            set;
        }
        [DataMember]
        public string PaperType
        {
            get;
            set;
        }
        [DataMember]
        public string PrinterName
        {
            get;
            set;
        }
        //[DataMember]
        //public RasterImage Image { get; set; }
        //[DataMember]
        //public RasterImageListItem ImageItem { get; set; }
        [DataMember]
        public bool isCheck
        {
            get;
            set;
        }
        [DataMember]
        public int DPI { get; set; }
        //public string Remark { get; set; }
        [DataMember]
        public string ProductName
        {
            get;
            set;
        }
        [DataMember]
        public bool IsClearBox { get; set; }
        [DataMember]
        public int PaperFaceId { get; set; }
        [DataMember]
        public int PaperTypeID { get; set; }
        [DataMember]
        public RasterImage Image { get; set; }
        //[DataMemberAttribute]
        //public RasterImageListItem ImageItem { get; set; }

        [DataMember]
        public int PixFactWidth { get; set; }
        [DataMember]
        public int PixFactHeigth { get; set; }

        /// <summary>
        /// 是否cmyk文件0RGB1Cmyk
        /// </summary>
        [DataMember]
        public int ColorType { get; set; }
        /// <summary>
        /// 处理一地多张
        /// </summary>
        [DataMember]
        public int PhotoNum { get; set; }
        [DataMember]
        public string DXFFilePath { get; set; }
        [DataMember]
        public byte[] DXFContent { get; set; }

        public bool IsContentDXF
        {
            get
            {
                if (string.IsNullOrEmpty(DXFFilePath))
                {
                    return false;
                }
                else
                {
                    return true;
                }
            }
            set { ; }
        }
        [DataMember]
        public string DisplayDXFFilePath {
            get
            {
                if (!string.IsNullOrEmpty(DXFFilePath))
                {
                    int lastFlag = DXFFilePath.LastIndexOf("\\");
                    if (lastFlag >= 0)
                    {
                        return DXFFilePath.Substring(lastFlag + 1);
                    }
                    else
                    {
                        return DXFFilePath;
                    }
                }
                else
                {
                    return "";
                }
            }
            set { ;  }
        }
    }
}
